/*-------------------<-- Start of Description-->---------------------\ | Get the maximum value from a list of numbers; | |---------------------<-- End of Description-->----------------------| |--------------------------------------------------------------------| |------------<-- Start of Files or Arguments Needed-->---------------| | Arguments: | | ListOfNumbers : a list of number; | |---------------<-- End of Files Arguments Needed-->-----------------| |--------------------------------------------------------------------| |------------------<-- Start of Files Created-->---------------------| | Example: %put %_max(1,2,3,4, 5); | | Usage: %_max(ListOfNumbers) | \-------------------<-- End of Files Created-->---------------------*/ %macro _max/parmbuff; /*--------------------------------------------\ | Copy Right: Duo Zhou | | Created: 3-23-2001 3:43pm; | | Purpose: Calculate the maximum number from | | a list of numbers; | \--------------------------------------------*/ %local _wcount_ _max_ ListOfNumbers; %let _wcount_=0; %let _max_=; %do %while(%length(%nrbquote(%qscan(%quote(&syspbuff), %eval(&_wcount_+1), %str(,() ))))); %let _wcount_=%eval(&_wcount_+1); %let word&_wcount_=%qscan(%quote(&syspbuff), &_wcount_, %str(,() )); %if (%quote(&_max_) eq) %then %let _max_=&&word&_wcount_; %else %if (&&word&_wcount_ gt &_max_) %then %let _max_=&&word&_wcount_; %end;&_max_ %mend _max;